package com.hzit.service.impl;

import com.hzit.mapper.ClassesMapper;
import com.hzit.service.ClassesService;
import com.hzit.util.MySqlSessionFactory;
import org.apache.ibatis.session.SqlSession;
import com.hzit.entity.Classes;

import java.io.IOException;
import java.util.List;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
public class ClassesServiceImpl implements ClassesService {

	/**
	 * 1. 查询所有班级
	 * @return
	 * @throws IOException
	 */
	@Override
	public List<Classes> findAll() throws IOException {
		try(SqlSession session = MySqlSessionFactory.getSqlSession(true)){
			ClassesMapper mapper = session.getMapper(ClassesMapper.class);
			return mapper.findAll();
		}
	}
}
